package renguanyu.app.tools;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import renguanyu.app.tools.util.FxmlUtl;
import renguanyu.app.tools.util.SystemUtil;

public class App extends Application {

	static {
		System.setProperty("java.net.useSystemProxies", "true");
	}

	public static void main(String[] args) throws Exception {
		launch(args);
	}

	public void start(Stage stage) throws Exception {
		Scene scene = new Scene(FxmlUtl.load("/view/MainView.fxml"));
		scene.getStylesheets().add("/styles/styles.css");
		stage.getIcons().add(new Image("/images/tools.png"));
		stage.setTitle(getTitle());
		stage.setScene(scene);
		stage.show();
	}

	public static String getTitle() {
		String title = "Tools";
		if (SystemUtil.isDevEnv()) {
			return String.format("[Dev] %s", title);
		}
		return title;
	}

}
